{% extends "common/layout.html" %}
{% block content %}
    <div class="row">
    <div class="col-lg-12">
        排序：<a href="{{ buildUrl('/?order=latest') }}" class="btn btn-link">最新</a>    <a href="{{ buildUrl('/?order=hot') }}" class="btn btn-link">热门</a>
    </div>
    </div>
    <div class="row" style="margin:10px 0;">
        {% if data %}
            {% for item in data %}
                <div class="col-md-2 ">
                    {#                    <a class="thumbnail" href="{{ buildUrl('/info?id=') }}{{ item.id }}">#}
                    <a class="thumbnail" href="{{ '%s?id=%s' | format( buildUrl('/info'),item.id ) }}">
                        <img style="width: 160px;height:260px" src="{{ item.cover_pic | safe }}"

                             alt="...">
{#                        {{ info |safe }} safe: 防止js攻击#}
                        <div class="caption">
                            <h3 style="overflow: hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{ item.name |safe }}</h3>
                            <p>{{ item.source.split('.')[1] | safe }}
                                | {{ item.pub_date.strftime("%Y-%m-%d") | safe }}</p>
                            {#        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>#}
                        </div>
                    </a>
                </div>
            {% endfor %}
        {% endif %}
    </div>
    {% include "common/pagenation.html" %}
{% endblock %}